

#include "CFilterProxyModel.h"

bool CFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const
{
    int time = sourceModel()->property(std::to_string(source_column).c_str()).toInt();
    int offset = time - start_s;

    return offset == 0 || (offset / interval > 0 && offset % interval == 0);
}

void CFilterProxyModel::SetInterval(int val)
{
    assert(val > 0);
    interval = val;
}

void CFilterProxyModel::SetStartTime(int val_s)
{
    start_s = val_s;
}
